<!-- 百度地图 -->
<template>
   
<Map ref="zmMap"></Map>
 
</template>
<script lang='ts' setup>
import { reactive} from 'vue';
import Map from './Map.vue'
const state=reactive<any>({
    mapEditForm:{
        address:'',
        lng:0,
        lat:0
    }
})
const querySearchAsync = async (queryString, cb) => {
  //调用后台接口查询地图服务
//   let resp = await getMapAddr({address:state.mapEditForm.address});
  // cb(resp.data)
}
//选中搜索建议后，触发该方法，实现定位标注效果

const handleSelect = (item:any) => {
        //item即为当前选中数据的返回实体
  let locationArr = item.location.split(",");
  state.mapEditForm.lng = locationArr[0];
  state.mapEditForm.lat = locationArr[1];
  state.zmMap.pointAdd(state.mapEditForm.lng,state.mapEditForm.lat)
}
</script>
<style lang='less'>
</style>